﻿@{Layout = "~/Views/Shared/_Layout.cshtml";}
@model Scheduling.Models.Course

<h2>@Model.ID Course Information</h2>
<table class="Info">
    <tr>
        <th>Course</th>
        <td>@Model.ID</td>
    </tr>
    <tr>
        <th>Course name</th>
        <td>@Model.Name</td>
    </tr>
    <tr>
        <th>Department</th>
        <td>@(Model.Department != null ? Model.Department.Name : "")</td>
    </tr>
    <tr>
        <th>Points</th>
        <td>@Model.Points</td>
    </tr>
    <tr>
        <th>Subject</th>
        <td>@Model.Subject.Name</td>
    </tr>
</table>

<h3>Course Instances:</h3>
<table class="Table" style="width:550px;">

        <tr>
            <th>Instance ID</th>
            <th>Term</th>
            <th>Period</th>
            <th>Start week</th>
            <th>End week</th>
            <th>Progression speed</th>
            <th>On campus?</th>
        </tr>

        @if (ViewData["CourseInstances"] != null)
        {
            foreach (var i in ViewData["CourseInstances"] as List<Scheduling.Models.CourseInstance>)
            {
                <tr>
                    <td>@i.ID</td>
                    <td>@i.Term</td>
                    <td>@i.Period</td>
                    <td>w. @i.StartWeek</td>
                    <td>w. @i.EndWeek</td>
                    <td>@i.ProgressionSpeed %</td>
                    <td>@i.OnCampus</td>
                </tr>
            }
        }
        else
        {
            <tr>
                <td>-</td>
                <td>-</td>
                <td>-</td>
                <td>-</td>
            </tr>
        }

</table>
@Html.ActionLink("Return to Search", "List")
